package stu.kurs.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


@Entity
@Table (name = "matches")
public class Match extends DomainObject {

	private static final long serialVersionUID = -7285375590104299162L;
	
	
	@Column (name = "team1", nullable = false)
	  private String team1;

	 
	 @Column (name = "team2", nullable = false)
	 private String team2;
	 

	 @Column (name = "scoreteam1", nullable = false)
	 private Integer scoreteam1;
	 
	 
	 @Column (name = "scoreteam2", nullable = false)
	 private Integer scoreteam2;

	 @Column (name = "koefteam1", nullable = false)
	 private Double koefteam1;

	 
	 @Column (name = "koefteam2", nullable = false)
	 private Double koefteam2;


	 @Column (name="date", nullable=false)
	 @Temporal(TemporalType.DATE)
	 private Date date;
	 
	 @ManyToOne
	 @JoinColumn (name = "category_id")
	 private Category category;
	
	
	 public Match() {
			super();
		}

		/**
		 * @param team1
		 * @param team1
		 * @param scoreteam1
		 * @param scoreteam2
		 * @param koefteam1
		 * @param koefteam2
		 * @param date
		 */
		public Match(String team1, String team2, Integer scoreteam1, Integer scoreteam2,
				Double koefteam1, Double koefteam2, Date date) {
			super();
			this.team1 = team1;
			this.team2 = team2;
			this.scoreteam1 = scoreteam1;
			this.scoreteam2 = scoreteam2;
			this.koefteam1 = koefteam1;
			this.koefteam2 = koefteam2;
			this.date = date;
		}

	 
	 
	 
	
 public String getTeam1() {
		return team1;
	}

	public void setTeam1(String team1) {
		this.team1 = team1;
	}

	public String getTeam2() {
		return team2;
	}

	public void setTeam2(String team2) {
		this.team2 = team2;
	}

	public Integer getScoreteam1() {
		return scoreteam1;
	}

	public void setScoreteam1(Integer scoreteam1) {
		this.scoreteam1 = scoreteam1;
	}

	public Integer getScoreteam2() {
		return scoreteam2;
	}

	public void setScoreteam2(Integer scoreteam2) {
		this.scoreteam2 = scoreteam2;
	}

	public Double getKoefteam1() {
		return koefteam1;
	}

	public void setKoefteam1(Double koefteam1) {
		this.koefteam1 = koefteam1;
	}

	public Double getKoefteam2() {
		return koefteam2;
	}

	public void setKoefteam2(Double koefteam2) {
		this.koefteam2 = koefteam2;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public Category getCategory() {
		return category;
	}

	public void setCategory(Category category) {
		this.category = category;
	}
}

